﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Baza.EF.BLL;

namespace Pep_3014_3070.Anonymous
{
    public partial class ActivateAccount : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                ActivateMyAccount();
            }
        }

        private void ActivateMyAccount()
        {
            int id = Convert.ToInt32((Request.QueryString["id"]));
            string email = Convert.ToString(Request.QueryString["email"]);
            if (id!= 0 && email!="")
            {
                DACustomers.activateCustomer(Convert.ToInt32((RouteData.Values["id"])), Convert.ToString(RouteData.Values["email"]));
                //Response.Write("Vas racun je uspjesno aktiviran. Prijavite se <a href='Login.aspx'>Login</a>  odmah! ");
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Vas racun je uspjesno aktiviran. Prijavite se <a href='Login.aspx'>Login</a>  odmah! ');", true);

            }
            else
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Vas racun je nije aktiviran!');", true);


        }
    }
}